<div align="center" class="layui-form-item" id="setext">
	<h1 align="middle" style="padding: 20px;">创建服务</h1>
	<form id="formService" class="layui-form" action="" lay-filter="formCreateService" style="width: 50rem;height: 53.125rem;">
		<div class="layui-form-item">
			<label class="layui-form-label">服务类型</label>
			<div class="layui-input-block">
				<select  name="seType" lay-filter="aihao">
					<option value="">请选择</option>
					<option value="0">咨询</option>
					<option value="1">投诉</option>
					<option value="2">建议</option>
				</select>
			</div>
		</div>
  
		<div class="layui-form-item">
			<label class="layui-form-label">输入内容</label>
			<div class="layui-input-block">
				<textarea name="seDetail" placeholder="请输入内容" class="layui-textarea"></textarea>
			</div>
		</div>
		
		<div class="layui-form-item">
			<label class="layui-form-label">创建人</label>
			<div class="layui-input-block">
				<input type="text" name="seCreator"  autocomplete="off" placeholder="请输入创建人" class="layui-input">
			</div>
		</div>
		
		<div class="layui-form-item">
			<label class="layui-form-label">创建时间</label>
			<div class="layui-input-block">
				<input type="text" class="layui-input" id="seCreatdate" name="seCreatdate"  placeholder="yyyy-MM-dd HH:mm:ss">
			</div>
		</div>
		
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button type="submit" class="layui-btn" lay-submit="" lay-filter="submitCreateService">立即创建</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
	layui.use(['form','laydate','jquery'], function(){
		var form = layui.form
		var laydate = layui.laydate;
		var $ = layui.jquery 
		
		form.render()

	 //日期时间选择器
	laydate.render({
		elem: '#seCreatdate'
		,type: 'datetime'
	  });
		  
	 //监听提交
	form.on('submit(submitCreateService)', function(d){
		
		
		if(form.verify()){
			//ajax提交参数
			$.ajax({
				url:'http://localhost:8080/serve/createServe',
				type:'POST',//提交方式post,get......
				dataType:'JSON',//后台返回数据的格式
				data:d.field,//要提交到后台的数据
				success:function(obj){
				//执行ajax提交成功后的代码
				//$('#setext').empty();	
				$("#setext input").val("")
				$("#setext textarea").val("")
				layer.msg(obj.msg)
				}
			})
		}				
		return false; //阻止form提交刷新
		
        
	  });
	})
</script>
